package com.xbts.system.module.payment.kit;

import com.xbts.system.module.payment.domain.RefundLog;
import com.xbts.system.module.payment.enums.PaymentMethodEnum;
import com.xbts.system.module.payment.kit.plugin.alipay.AliPayPlugin;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

/**
 * 退款支持
 *
 * @author Chopper
 * @since 2020-12-19 09:25
 */
@Component
@Slf4j
public class RefundSupport {


    /**
     * 售后退款
     *
     * @param afterSale
     */
    public void refund(Object afterSale) {
        RefundLog refundLog = new RefundLog();
        Payment payment = new AliPayPlugin();
        payment.refund(refundLog);
    }


    /**
     * 退款通知
     *
     * @param paymentMethodEnum 支付渠道
     */
    public void notify(PaymentMethodEnum paymentMethodEnum, HttpServletRequest request) {

        //获取支付插件
        Payment payment = new AliPayPlugin();
        payment.refundNotify(request);
    }

}
